package com.yc.backstage.controller;

import com.yc.backstage.service.SysDictTypeService;
import com.yc.common.res.ResultClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Classname SysDictTypeController
* @Description
* @Version 1.0.0
* @Date 2022-08-23 11:49:19
* @Created by Mikechen
*/
@RestController
@RequestMapping("/backstage/sysDictType")
public class SysDictTypeController {
    @Autowired
    private SysDictTypeService sysDictTypeService;
    /**
     * 根据字典type类型查询数据
     */
    @PreAuthorize("@el.hasRole('system:dict:query')")
    @GetMapping(value = "/{dictType}")
    public ResultClass getInfo(@PathVariable("dictType") String dictType) {
        return ResultClass.success(sysDictTypeService.selectDictTypeByType(dictType));
    }
}
